Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. serious problem

serious problem

Scheduled Pinned Locked Moved ASP.NET
csshelpquestion
10 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    amit__8
    wrote on last edited by
    #1

    Hi i wanted to create a product comparision.user will select some products and than it will display side by side comparision. i tried datalist,grid, pivot table but still facing problem. in pivot table we r unable to display iamge and in datalist i am unable to display column headings and data in proper format pls suggest me. any idea or any link from there i can get some source code or idea to create the same?

    D 1 Reply Last reply
    0
    • A amit__8

      Hi i wanted to create a product comparision.user will select some products and than it will display side by side comparision. i tried datalist,grid, pivot table but still facing problem. in pivot table we r unable to display iamge and in datalist i am unable to display column headings and data in proper format pls suggest me. any idea or any link from there i can get some source code or idea to create the same?

      D Offline
      D Offline
      deanofharvard
      wrote on last edited by
      #2

      Try using a DataGrid and the TemplateColumns. It's worked for me. Not very hard to use. A link to a tutorial is below. http://aspnet.4guysfromrolla.com/articles/061002-1.aspx[^] You'll have to set autogeneratecolumns to false. Then, you don't even need a column header! You can format whatever you need in a table, or whatever you want. **Description:** <%# DataBinder.Eval(Container.DataItem, "Description") %> **Category Name:** <%# DataBinder.Eval(Container.DataItem, "CatName") %> **View Count:** <%# DataBinder.Eval(Container.DataItem, "ViewCount", "{0:#,###}") %> (code sample from 4guysfromrolla.com)

      D 1 Reply Last reply
      0
      • D deanofharvard

        Try using a DataGrid and the TemplateColumns. It's worked for me. Not very hard to use. A link to a tutorial is below. http://aspnet.4guysfromrolla.com/articles/061002-1.aspx[^] You'll have to set autogeneratecolumns to false. Then, you don't even need a column header! You can format whatever you need in a table, or whatever you want. **Description:** <%# DataBinder.Eval(Container.DataItem, "Description") %> **Category Name:** <%# DataBinder.Eval(Container.DataItem, "CatName") %> **View Count:** <%# DataBinder.Eval(Container.DataItem, "ViewCount", "{0:#,###}") %> (code sample from 4guysfromrolla.com)

        D Offline
        D Offline
        deanofharvard
        wrote on last edited by
        #3

        Um... The form butchered the code. Follow the link above to see what I was talking about.

        A 1 Reply Last reply
        0
        • D deanofharvard

          Um... The form butchered the code. Follow the link above to see what I was talking about.

          A Offline
          A Offline
          amit__8
          wrote on last edited by
          #4

          Hi thanks again.i already tried that code but problem is that this code will display colmn headings for each n every time when there is a record in the database; display will looks like: id CP100 id cp200 id cp3000 name xyz name ass name asassa and i wants to display my product comparision like the following: id cd100 cd200 cd3000 name xyz ass asasas if i will define table outside grid than i am unable to use the same table into grid. pls suggest me any solution.

          D 1 Reply Last reply
          0
          • A amit__8

            Hi thanks again.i already tried that code but problem is that this code will display colmn headings for each n every time when there is a record in the database; display will looks like: id CP100 id cp200 id cp3000 name xyz name ass name asassa and i wants to display my product comparision like the following: id cd100 cd200 cd3000 name xyz ass asasas if i will define table outside grid than i am unable to use the same table into grid. pls suggest me any solution.

            D Offline
            D Offline
            deanofharvard
            wrote on last edited by
            #5

            Here's the code that I used for my Testimonial View page. In order to use any of the manual columns you need to make sure that you set the "AutoGenerateColumns" to false, either in the datagrid tag or the codebehind. When you define the columns, there are different types, and manual headers that you can add. You can find more examples of this at asp.net, in the Tutorials section. The code below is what you'd do if you wanted to avoid the auto-generated table almost entirely. For each record the DataGrid wraps a <td> tag around the code I've got in the asp:TemplateColumn tag. * * * **<%# DataBinder.Eval(Container.DataItem, "FName") %>   <%# DataBinder.Eval(Container.DataItem, "LName") %>** <%# DataBinder.Eval(Container.DataItem, "City") %>,   <%# DataBinder.Eval(Container.DataItem, "State") %> **Before** ![](imagebin/<%# DataBinder.Eval(Container.DataItem, "BImageName") %>) **After** ![](imagebin/<%# DataBinder.Eval(Container.DataItem, "AImageName") %>) <%# DataBinder.Eval(Container.DataItem, "Testimonial") %> But from your reply it seems that you want a more typical format. Below is a link to the ASP.Net DataGrid tutorials page. This is pretty extensive, and shows how to properly add columns to a datagrid. You can use either CodeBehind or manually cr

            A 1 Reply Last reply
            0
            • D deanofharvard

              Here's the code that I used for my Testimonial View page. In order to use any of the manual columns you need to make sure that you set the "AutoGenerateColumns" to false, either in the datagrid tag or the codebehind. When you define the columns, there are different types, and manual headers that you can add. You can find more examples of this at asp.net, in the Tutorials section. The code below is what you'd do if you wanted to avoid the auto-generated table almost entirely. For each record the DataGrid wraps a <td> tag around the code I've got in the asp:TemplateColumn tag. * * * **<%# DataBinder.Eval(Container.DataItem, "FName") %>   <%# DataBinder.Eval(Container.DataItem, "LName") %>** <%# DataBinder.Eval(Container.DataItem, "City") %>,   <%# DataBinder.Eval(Container.DataItem, "State") %> **Before** ![](imagebin/<%# DataBinder.Eval(Container.DataItem, "BImageName") %>) **After** ![](imagebin/<%# DataBinder.Eval(Container.DataItem, "AImageName") %>) <%# DataBinder.Eval(Container.DataItem, "Testimonial") %> But from your reply it seems that you want a more typical format. Below is a link to the ASP.Net DataGrid tutorials page. This is pretty extensive, and shows how to properly add columns to a datagrid. You can use either CodeBehind or manually cr

              A Offline
              A Offline
              amit__8
              wrote on last edited by
              #6

              i just wants a simple display fist column would contains all column headings and from second column the data will be displayed like the following: Brand LG samsung nokia price 12 11 112 specification x y z i am keep trying since 2 weeks but still unable to find solution.

              D 1 Reply Last reply
              0
              • A amit__8

                i just wants a simple display fist column would contains all column headings and from second column the data will be displayed like the following: Brand LG samsung nokia price 12 11 112 specification x y z i am keep trying since 2 weeks but still unable to find solution.

                D Offline
                D Offline
                deanofharvard
                wrote on last edited by
                #7

                Are you trying to do it sideways? With the column headings to the left? The way it would work is Head Head Head Img Brand Price Img Brand Price Img Brand Price Or whichever order you decide... Otherwise, you could just create a TemplateColumn, and inside, create a table with three cells, or format it however you want. It's got a LOT of flexibility. Check out the online examples of what the templatecolumn can do for you on asp.net.

                A 1 Reply Last reply
                0
                • D deanofharvard

                  Are you trying to do it sideways? With the column headings to the left? The way it would work is Head Head Head Img Brand Price Img Brand Price Img Brand Price Or whichever order you decide... Otherwise, you could just create a TemplateColumn, and inside, create a table with three cells, or format it however you want. It's got a LOT of flexibility. Check out the online examples of what the templatecolumn can do for you on asp.net.

                  A Offline
                  A Offline
                  amit__8
                  wrote on last edited by
                  #8

                  yes i am trying for side by side comparision. from where i can get online example for side by side ?

                  D 1 Reply Last reply
                  0
                  • A amit__8

                    yes i am trying for side by side comparision. from where i can get online example for side by side ?

                    D Offline
                    D Offline
                    deanofharvard
                    wrote on last edited by
                    #9

                    Sorry, I'm lost on that one too... You might want to generate custom HTML for this one. It won't be as versatile as a DataGrid, but it'll work. Use an OleDbDataAdapter (oDA) and do a while(oDA.Read) { oDA["MyField"].ToString(); } You can make a StringBuilder that will create your HTML table for you, pulling the info from the DB as listed above. Hope this helps...

                    A 1 Reply Last reply
                    0
                    • D deanofharvard

                      Sorry, I'm lost on that one too... You might want to generate custom HTML for this one. It won't be as versatile as a DataGrid, but it'll work. Use an OleDbDataAdapter (oDA) and do a while(oDA.Read) { oDA["MyField"].ToString(); } You can make a StringBuilder that will create your HTML table for you, pulling the info from the DB as listed above. Hope this helps...

                      A Offline
                      A Offline
                      amit__8
                      wrote on last edited by
                      #10

                      how can i use string builder; i never used it any detail ex. pls?

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups